TECopy
TECopy Copy selection range to the TextEdit scrap
#include <TextEdit.h> TextEdit
void TECopy(hTE );
TEHandle hTE ; handle of an edit record
For new TextEdit records created using TEStylNew, the routines TECut and
TECopy will write the text and its style information directly to the desk
scrap, as scrap types 'TEXT' and 'styl'. For compatibility with older TextEdit
routines, TECopy and TECut will also write a handle to the old global
For old TextEdit records, TECopy and TEPaste will work as they always
have, copying and pasting via the private TextEdit scrap only. Remember to
use ZeroScrap and TEToScrap to copy your private scrap to the desk scrap.
hTE is a handle obtained via TENew (old style TextEdit record) or
TEStylNew (new style TextEdit record). It leads to a
variable-length TERec structure and identifies the edit record to be
affected by this change.
Returns: none

Notes: Any text currently in the TextEdit scrap is removed and the
selected text is stored there. If no selection range is identified, the scrap is
emptied.
This stores a 'TEXT' element into the desk scrap (see GetScrap). On
style-aware edit records, it also stores a 'styl' element, in the format of a
StScrpRec structure.
Use TECut to copy text to the scrap while deleting it from the edit record.
If you are using old style TextEdit records, you must use TEToScrap to
copy the TextEdit internal scrap into the system scrap and TEFromScrap
for the the reverse and use TEScrapHandle to get direct access to data in
the TextEdit scrap.
To save and restore styled text from a file, see Saving Styled Text.